Skip to content

Instantly share code, notes, and snippets.

@cszentkiralyi
cszentkiralyi / vim-sexp-cheatsheet.md
Last active December 22, 2025 05:37
vim-sexp cheatsheet

Prereqs

These are for the combined vim-sexp (https://github.com/guns/vim-sexp) and vim-sexp-mappings-for-regular-people (https://github.com/tpope/vim-sexp-mappings-for-regular-people) plugins. vim-sexp is neat on its own but Tim Pope makes common stuff much easier.

Note that some vim-sexp functionality depends on <LocalLeader> mappings. This is a different leader key than the global leader, and is the variable maplocalleader (instead of mapleader). To see if you have this set, use :echo maplocalleader; if it errors out you'll need to set it, otherwise it will echo the key. If you want to set your LocalLeader to <Space>, you'll need two commands in your .vimrc, since by default <Space> is bound to <Right> in normal mode:

nnoremap <Space> <Nop>
let maplocalleader=" "

TOC

Hacking HY300 Pro+ Projector (720p)

Hello manufacturer. Good device. But software we want to customize. If you allow, we will buy more.

Despite being advertised as "4K 1080P", it really downscales those to 720P.

But for 28.50 EUR from Amazon Warehuose Germany in 2025, one can't exactly complain. https://www.amazon.de/dp/B0DSP74YQW

Chengdu Hotack Technology Co., Ltd. is the OEM?

@laamaa
laamaa / m8-incremental-backup.sh
Created October 2, 2025 16:28
A bash script that creates incremental backups of an SD card on macOS using rsync
#!/bin/bash
#
# Incremental backup script for SD card on macOS with rotation
#
# === CONFIGURATION ===
SDCARD="/Volumes/M8" # Mount point of the SD card
BACKUPDIR="$HOME/Backups/m8-sd-backups" # Where backups are stored
DATE=$(date +%Y-%m-%d-%H%M%S) # Timestamp for snapshot folder
DEST="$BACKUPDIR/backup-$DATE" # New backup folder
@t3dotgg
t3dotgg / try-catch.ts
Last active December 22, 2025 05:21
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@mstevenson
mstevenson / Fps.cs
Last active December 22, 2025 05:19
An accurate FPS counter for Unity. Works in builds.
using UnityEngine;
using System.Collections;
public class Fps : MonoBehaviour
{
private float count;
private IEnumerator Start()
{
GUI.depth = 2;
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active December 22, 2025 05:18
Hyperlinks in Terminal Emulators
@Changaco
Changaco / btrfs-undelete
Last active December 22, 2025 05:18
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <info@syntax-k.de>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
@adammyhre
adammyhre / CrowdInstance.shader
Created December 21, 2025 12:25
Compute Shader Example
Shader "Crowd/InstancedAgent" {
SubShader {
Tags { "RenderPipeline"="UniversalRenderPipeline" "RenderType"="Opaque" }
Pass {
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
@MarvNC
MarvNC / get-discord-token-from-browser.md
Last active December 22, 2025 04:57
How to Get Your Discord Token From the Browser Developer Console

How to Get Your Discord Token From the Browser Console

New method (contributed by youyoumu)

  • Open the browser console with F12 or Ctrl + Shift + I.
  • Enable mobile device emulation with Ctrl + Shift + M.
  • Paste the following code into the console and press Enter:
const iframe = document.createElement('iframe');
@tamboer
tamboer / git_clean.txt
Created June 24, 2013 10:10
git clean
git clean -f
If you want to also remove directories, run git clean -f -d.
If you just want to remove ignored files, run git clean -f -X.
If you want to remove ignored as well as non-ignored files, run git clean -f -x.
Note the case difference on the X for the two latter commands.